(function(){"use strict";BX.namespace("BX.Landing.Block");var n=BX.Landing.Utils.isFunction;var e=BX.Landing.Utils.isString;var t=BX.Landing.Utils.isPlainObject;var i=BX.Landing.Utils.isArray;var o=BX.Landing.Utils.bind;var s=BX.Landing.Utils.proxy;var r=BX.Landing.Utils.data;BX.Landing.Block.Node=function(i){this.node=i.node;this.manifest=t(i.manifest)?i.manifest:{};this.selector=e(i.selector)?i.selector:"";this.onChangeHandler=n(i.onChange)?i.onChange:function(){};this.onDesignShow=n(i.onDesignShow)?i.onDesignShow:function(){};this.changeOptionsHandler=n(i.onChangeOptions)?i.onChangeOptions:function(){};this.onDocumentClick=s(this.onDocumentClick,this);this.onDocumentKeydown=s(this.onDocumentKeydown,this);o(document,"click",this.onDocumentClick);o(document,"keydown",this.onDocumentKeydown);Object.freeze(this.manifest);this.node.dataset.selector=this.selector;if(this.isAllowInlineEdit()){this.onAllowInlineEdit()}};BX.Landing.Block.Node.storage=[];BX.Landing.Block.Node.prototype={onDocumentClick:function(n){},onDocumentKeydown:function(n){if(n.keyCode===27){this.onEscapePress()}},onEscapePress:function(){},getField:function(){throw new Error("Must be implemented by subclass")},showEditor:function(){},hideEditor:function(){},onAllowInlineEdit:function(){},isAllowInlineEdit:function(){return this.manifest.allowInlineEdit!==false},isGrouped:function(){return typeof this.manifest.group==="string"&&this.manifest.group.length>0},setValue:function(n,e,t){throw new Error("Must be implemented by subclass")},getValue:function(){throw new Error("Must be implemented by subclass")},getAdditionalValue:function(){if(t(this.manifest.extend)&&i(this.manifest.extend.attrs)){return this.manifest.extend.attrs.reduce(function(n,e){return n[e]=r(this.node,e),n}.bind(this),{})}return{}},onChange:function(n){this.onChangeHandler.apply(null,[this,n])},getIndex:function(){var n=parseInt(this.selector.split("@")[1]);n=n===n?n:0;return n},preventSave:function(n){this.isSavePreventedValue=n},isSavePrevented:function(){return!!this.isSavePreventedValue},getBlock:function(){return BX.Landing.PageObject.getBlocks().getByChildNode(this.node)},preparePseudoUrl:function(n){let e=false;if(!(n.href==="#"&&n.target==="")){e=true}if(n.href==="selectActions:"){n.href="";n.enabled=false;e=true}if(n.href.startsWith("product:")){n.target="_self";e=true}if(n.enabled!==false){if(n.href===""||n.href==="#"){n.enabled=false;e=true}}if(n.target===""){n.target="_blank";e=true}if(e===true){return n}return null}}})();
//# sourceMappingURL=node.map.js